#ifndef VIDEOMAKER_H
#define VIDEOMAKER_H

#include <QDialog>
#include <QListWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QCheckBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QStringList>
#include <QDebug>

#define WIDTH 1920
#define HEIGHT 1080
#define MARGIN 20

class VideoMaker : public QDialog
{
Q_OBJECT
public:
    explicit VideoMaker(QWidget *parent = 0);

signals:

private:
    void createInterface();
    int checkFrame(QString hour, QString min, QString sec, QString num);
    QString checkImage(QString hour, QString min, QString sec, QString num, QString path);
    void getNextFrame(QString &hour, QString &min, QString &sec, QString &num);
    void getLastFrame(QString &hour, QString &min, QString &sec, QString &num);
    int createVideo(QStringList *frameList, int width, int height, QString savepath);

    QVBoxLayout *mainVLayout;
    QHBoxLayout *listBtnHLayout;
    QHBoxLayout *layoutHLayout;
    QHBoxLayout *ckbHLayout;
    QHBoxLayout *pathHLayout;

    QListWidget *ltwImageDirList;

    QLineEdit *letCol;
    QLineEdit *letRow;
    QLineEdit *letHour;
    QLineEdit *letMin;
    QLineEdit *letSec;
    QLineEdit *letFraNo;
    QLineEdit *letTotal;
    QLineEdit *lblSavePath;

    QPushButton *btnAddItem;
    QPushButton *btnRemoveItem;
    QPushButton *btnItemUp;
    QPushButton *btnItemDown;
    QPushButton *btnSelectPath;
    QPushButton *btnCreateVideo;
    QPushButton *btnCreatefImages;

    QCheckBox *ckbRotate;
    QCheckBox *ckbOrgResolution;
    QCheckBox *ckbRepetFramedrop;

    QStringList *allFrames;

public slots:
    void onAddItemClicked();
    void onRemoveItemClicked();
    void onUpItemClicked();
    void onDownItemClicked();
    void onSeletPathClicked();
    void onCreateVideoClicked();
    void onCreatefImagesClicked();
};

#endif // VIDEOMAKER_H
